package com.zte.claa.inficombo.csa.app.model.redis;

import java.io.Serializable;

@SuppressWarnings("serial")
public class AlarmCode implements Serializable{
	public static final byte CODE_TP_INFORM = 0;
	public static final byte CODE_TP_DEVALARM = 1;
	public static final byte CODE_TP_THALARM = 2;
	public static final byte CODE_TP_OTHER = 3;

	private byte codetype;
	private int  codegroup = 1;
	private String devtype;
	private String alarmcode;
	private String remark;
	
	public AlarmCode(){
		
	}

	public byte getCodetype() {
		return codetype;
	}

	public void setCodetype(byte codetype) {
		this.codetype = codetype;
	}

	public String getDevtype() {
		return devtype;
	}

	public void setDevtype(String devtype) {
		this.devtype = devtype;
	}

	public String getAlarmcode() {
		return alarmcode;
	}

	public void setAlarmcode(String alarmcode) {
		this.alarmcode = alarmcode;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	/**
	 * @return the codegroup
	 */
	public int getCodegroup() {
		return codegroup;
	}

	/**
	 * @param codegroup the codegroup to set
	 */
	public void setCodegroup(int codegroup) {
		this.codegroup = codegroup;
	}

	public String toString(){
		StringBuilder sb = new StringBuilder();
		sb.append("devtype=").append(devtype).append(", ");
		sb.append("alarmcode=").append(alarmcode).append(", ");
		sb.append("codetype=").append(codetype).append(", ");
		sb.append("codegroup=").append(codegroup).append(", ");
		sb.append("remark=").append(remark).append(".");		
		return sb.toString();
	}
	
	/**
     * 
     */
    public boolean equals(Object dest){
    	if(dest == null){
    		return false;
    	}    	
    	if(dest == this){
    		return true;
    	}
    	if(!AlarmCode.class.isInstance(dest)){
    		return false;
    	}
    	AlarmCode fm = (AlarmCode)dest;
    	return (this.devtype.equals(fm.getDevtype()) &&
    			this.alarmcode.equals(fm.getAlarmcode()));    	
    }
}
